package com.mustafaiev.tair.autobase.web.command;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import com.mustafaiev.tair.autobase.web.AutobaseServlet;

/**
 * 
 * The Command pattern interface for {@link AutobaseServlet} servlet controller
 * 
 * @author Tair Mustafaiev
 * 
 */
public interface AutobaseServletCommand {
	
	public static final String SESS_AUTH = "auth";

	/**
	 * 
	 * Called by the method doGet of Class {@link AutobaseServlet} to allow a
	 * servlet to handle a GET request.
	 * 
	 * @param req
	 * @param resp
	 * @throws ServletException
	 * @throws IOException
	 */
	void processGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException;

	/**
	 * 
	 * Called by the method doPost of class {@link AutobaseServlet} to allow a
	 * servlet to handle a POST request.
	 * 
	 * @param req
	 * @param resp
	 * @throws ServletException
	 * @throws IOException
	 */
	void processPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException;
}
